import request from '@/utils/request'

export default {
  getByLeagueId(leagueId){
    return request({
      url: `/card/league/${leagueId}`,
      method: 'get',
    })
  },

  getAll(){
    return request({
      url: `/card`,
      method: 'get',
    })
  },

  //查询储蓄类型的卡
  getType(){
    return request({
      url: `/card/byCardType`,
      method: 'get',
    })
  },
  getList(currentPage,pageSize,cardSearch){
    return request({
      url: `/card/search/${currentPage}/${pageSize}`,
      method: 'post',
      data: cardSearch
    })
  },
  getById(id){
    return request({
      url: `/card/${id}`,
      method: 'get'
    })
  },
  delete(id){
    return request({
      url: `/card/${id}`,
      method: 'delete'
    })
  },
  modify(card){
    return request({
      url: `/card`,
      method: 'put',
      data: card
    })
  },
  add(card){
    return request({
      url: `/card`,
      method: 'post',
      data: card
    })
  },
  getCard(leagueId){
    return request({
      url: `/card/card/${leagueId}`,
      method: 'get',
    })
  }
}
